import {
  produceAxios1,
  getAction,
  deleteAction,
  putAction,
  postAction,
  httpAction,
  fromDataPostAction,
  fromDataPostActionMultipart,
} from "@/api/manage";

//  申请领料==================================

// 工单列表
export const workOrderList = (params) =>
  postAction("/jksaas-produce/produce/produceorder/produceOrderInfo/list", params);

export const workOrderListProduce = (params) =>
postAction("/jksaas-produce/produce/produceorder/produceOrderInfo/list", params);

export const produceOrderReportWorkWorkbenchProduce = (params) => getAction(`/jksaas-produce/produce/produce/produceOrderTask/queryById`,params) // 详情

// 工单详情
export const workOrderDetailQueryById = (params) =>
  getAction("/jksaas-produce/produce/produceorder/produceOrderInfo/queryById", params);

  // 报工详情
export const produceOrderReportWorkQueryById = (params) =>
getAction("/jksaas-produce/produce/reportwork/produceOrderReportWork/queryById", params);
// 删除报工
export const produceOrderReportWorkDelete = (params) =>
deleteAction("/jksaas-produce/produce/reportwork/produceOrderReportWork/delete", params);

  export const scheduleById = (params) =>
  getAction("/jksaas-produce/produce/reportwork/produceOrderReportWork/scheduleById", params);

  // 不合格原因列表
export const basicNonconformityList = (params) =>
getAction("/jksaas-produce/produce/basic/basicNonconformity/list", params);
// 新建
export const materialRequisitionAdd = (params) =>
  postAction("/produceReceiveMaterial/add", params);

//审批流程
export const flowableModelDatas = (params) =>
  getAction(`/proc/model/lineInfo`, params);

// 查询该工单下的物料
export const getGoodsByOrderId = (params) =>
  getAction("/produceReceiveMaterial/queryByOrderId", params);

// 领料详情
export const materialRequisitionDetail = (params) =>
  getAction("/produceReceiveMaterial/getById", params);

//  申请补料==================================
export const getSupplementaryMaterialGoodsByOrderId = (params) =>
  getAction("/produceMaterialRemedy/queryByOrderId", params); // 查询该工单下的物料
// 添加补料
export const supplementaryMaterialAdd = (params) =>
  postAction("/produceMaterialRemedy/add", params);

// 补料详情
export const supplementaryMaterialDetail = (params) =>
  getAction("/produceMaterialRemedy/getById", params);

//  申请退料==================================
export const getMaterialReturnGoodsByOrderId = (params) =>
  getAction("/produceMaterialsReturned/queryByOrderId", params); // 查询该工单下的物料

// 提交
export const materialReturnAdd = (params) =>
  postAction("/produceMaterialsReturned/add", params);
// 退料详情
export const materialReturnDetail = (params) =>
  getAction("/produceMaterialsReturned/getById", params);

export const productionReportingAdd = (params) => postAction('/jksaas-produce/produce/reportwork/produceOrderReportWork/add', params)
// 编辑报工
export const produceOrderReportWorkEdit = (params) => putAction('/jksaas-produce/produce/reportwork/produceOrderReportWork/edit', params)

// 任务详情
export const produceOrderReportWorkWorkbench = (params) => getAction(`/jksaas-produce/produce/produce/produceOrderTask/queryById`,params) // 详情

// 可报工数大于0的工序下拉框
export const processByOrderId = (params) => getAction('/management/productionTask/processByOrderId', params)

// 根据工序id获取详情信息
export const productionTaskProcessMessage = (params) => getAction('/management/productionTask/processMessage', params)

// 根据批次id回填工序(移动端批次报工扫码)
export const processByBatchId = (params) => getAction('/management/productionTask/processByBatchId', params)


// 工艺路线变更记录详情
export const produceOrderAlterRecordGetById = (params) => getAction('/produceOrderAlterRecord/getById', params)


// 生产订单
export const productionLineList = (params) => getAction('/baseSetting/productionLine/list', params)
export const productionOrderVerify = (params) => getAction('/productionorder/productionOrder/verify', params)
export const distributionBatch = (params) => postAction('/productionorder/productionOrder/distributionBatch', params)

// 生产投料
export const feedQueryByOrderId = (params) => getAction('/produce/feed/queryByOrderId', params)
export const feedingAdd = (params) => postAction('/produce/feeding/add', params)

// 生产任务暂停
export const productionTaskUpdatePause = (params) => postAction('/management/productionTask/updatePause', params)